from google.appengine.api import mail
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util

class MainHandler(webapp.RequestHandler):
    def get(self):
        message = mail.EmailMessage(sender="again4you@gmail.com", subject="This is a test")
        message.to = "again4you@gmail.com"
        message.body = "Test!!"
        message.Send()
        self.response.out.write("Mail is sent!")
    
def main():
    application = webapp.WSGIApplication([('/mail', MainHandler)],
                                         debug=True)
    util.run_wsgi_app(application)


if __name__ == '__main__':
    main()